home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / CNews / Source / rna / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-09  |  3.2 KB  |  133 lines

  1. #include <sys/types.h>
  2. #include <sys/stat.h>
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <ctype.h>
  6. #include <time.h>
  7. #ifdef USG
  8. #include <fcntl.h>
  9. #endif
  10. #include <signal.h>
  11.  
  12. /* C News header(s) */
  13. #include <config.h>
  14.  
  15. #define NEWSVERSION     "B UNSW 1.1 19 Sep 1984, heavily hacked for C News"
  16.  
  17. /* Things that very well may require local configuration */
  18.  
  19. /*#define UNSWMAIL 1*/            /* if you have UNSW "mail" which
  20.                        allows "-s subject -i include_file"
  21.                        arguments */
  22. #define MAIL    "/bin/mail"
  23. #if UNSWMAIL
  24. #define FASTMAIL    "/bin/mail"
  25. #else
  26. #define FASTMAIL    MAIL
  27. #endif
  28.  
  29.  
  30. /* Things you might want to change */
  31.  
  32. /* #define MANGRPS     1        /* if you have mandatory subscriptions
  33.                        tailored per-person (uses
  34.                        getclasses()) */
  35. #define NEWSRC  ".newsrc"        /* name of .newsrc file */
  36. #define    PAGESIZE 24            /* lines on screen */
  37. #define ARTICLES "articles"        /* default place to save articles */
  38. #define BUFLEN    256            /* standard buffer size */
  39.  
  40. /* Things you probably won't want to change */
  41.  
  42. #define NEGCHAR    '!'            /* newsgroup negation character    */
  43. #define NEGS    "!"            /* ditto (string) */
  44. #define BADGRPCHARS "/#!"        /* illegal chars in group name */
  45. #define    NGSEPCHAR ','    /* delimit character in news group line        */
  46. #define NGSEPS    ","    /* ditto */
  47. #define PSEPS "!"    /* separator in Path: */
  48. #define PSEPCHAR '!'    /* ditto */
  49. #define TRUE    1
  50. #define FALSE    0
  51.  
  52. #ifndef F_SETFD
  53. #ifdef F_SETFL
  54. #define F_SETFD F_SETFL        /* SETFL becomes SETFD (close on exec arg
  55.                    to fcntl) */
  56. #endif
  57. #endif
  58.  
  59. typedef enum booltype { false = 0, true } bool;
  60. typedef enum applytype { stop, next, nextgroup, searchgroup } applycom;
  61. typedef applycom (*apcmfunc)();
  62. typedef enum pheadtype { printing, passing, making } pheadcom;
  63.  
  64. /*
  65.  * header structure
  66.  */
  67. typedef struct header {
  68.     /* mandatory fields */
  69.     char    *h_relayversion;
  70.     char    *h_postversion;
  71.     char    *h_from;
  72.     char    *h_date;
  73.     char    *h_newsgroups;
  74.     char    *h_subject;
  75.     char    *h_messageid;
  76.     char    *h_path;
  77.     /* optional fields */
  78.     char    *h_replyto;
  79.     char    *h_sender;
  80.     char    *h_followupto;
  81.     char    *h_datereceived;
  82.     char    *h_expires;
  83.     char    *h_references;
  84.     char    *h_control;
  85.     char    *h_distribution;
  86.     char    *h_organisation;
  87.     char    *h_lines;
  88.     /* any we don't recognise */
  89.     char    *h_others;
  90. } header;
  91.  
  92. /*
  93.  * internal structure for active file
  94.  */
  95. typedef struct active active;
  96. struct active {
  97.     char    *a_name;
  98.     long    a_seq;
  99.     long    a_low;
  100.     active    *a_next;
  101. };
  102.  
  103. /*
  104.  * internal struct for newsrc file
  105.  */
  106. typedef struct newsrc newsrc;
  107. struct newsrc {
  108.     char    *n_name;
  109.     bool    n_subscribe;
  110.     long    n_last;
  111.     newsrc    *n_next;
  112. };
  113.  
  114. /* some of these may not exist any more */
  115. char    *strrchr(), *strchr(), *strcat(), *strcpy(), *strpbrk();
  116. char    *itoa(), *ltoa(), *convg(), *ngsquash(), *ttoa(), *mgets(), *rconvg();
  117. char    *newstr(), *newstr2(), *newstr3(), *newstr4(), *newstr5(), *catstr();
  118. char    *catstr2(), *bsearch(), *mtempnam(), *newstr6();
  119. char    *getunique(), *getretaddr(), *getsubject();
  120. FILE    *fopenl(), *fopenf();
  121. char    *myalloc(), *myrealloc();
  122. long    time(), atol(), atot();
  123. int    strpcmp();
  124. active    *readactive();
  125. char *getenv();
  126.  
  127. #define NIL(type)    ((type *) 0)
  128. #define NEW(type)    ((type *) myalloc(sizeof(type)))
  129. #define CMP(a, b)    (*(a) != *(b) ? *(a) - *(b) : strcmp(a, b))
  130. #define CMPN(a, b, n)    (*(a) != *(b) ? *(a) - *(b) : strncmp(a, b, n))
  131.  
  132. extern char mailvia[];
  133.